package me.a_littlesquid.origin.utils;


import org.bukkit.configuration.file.FileConfiguration;

import java.io.File;


public class Random {
    public Random (FileConfiguration data , File filedata){
        this.data=data;
        this.filedata=filedata;
    }
    private FileConfiguration data;
    private File filedata;
    public String Ramdonorigin(){
        String result=null;
        int ck= data.getInt("originlist.ck.probability");
        int zt= data.getInt("originlist.ck.probability");
        int zzgw= data.getInt("originlist.zzqw.probability");
        int xt=data.getInt("originlist.xt.probability");
        int my=data.getInt("originlist.my.probability");
        int zs=data.getInt("originlist.zs.probability");
        int pt=data.getInt("originlist.pt.probability");
        int a=ck;
        int b=ck+zt;
        int c=ck+zt+zzgw;
        int d=ck+zt+zzgw+xt;
        int e=ck+zt+zzgw+xt+my;
        int f=ck+zt+zzgw+xt+my+zs;
        int g=ck+zt+zzgw+xt+my+zs+pt;
        int value=(int)(Math.random()*100);
        if (value<a){
            result="ck";
        }
        if (value<b&value>=a){
            result="zt";
        }
        if (value<c&value>=b){
            result="zzgw";
        }
        if (value<d&value>=c){
            result="xt";
        }
        if (value<e&value>=d){
            result="qs";
        }
        if (value<f&value>=e){
            result="my";
        }
        if (value<g&value>=f){
            result="zs";
        }
        if (value>=g){
            result="pt";
        }
        return result;
    }
}